package com.zhuoan.webapp.controller.bank;

import com.zhuoan.biz.bank.BankBiz;
import com.zhuoan.model.Bank;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * User
 *
 * @author weixiang.wu
 * @date 2018-06-13 17:19
 **/
@Controller
@RequestMapping("/")
public class BankController {
    private final static Logger logger = LoggerFactory.getLogger(BankController.class);

    @Resource
    private BankBiz bankBiz;

    /**
     * @api {post} /addBank  新增测试
     * @apiDescription 新增信息的一些描述一下，下面的描述只是一个傻乎乎的注释demo
     * @apiGroup Bank
     * @apiParam {string} bankName 银行名称
     * @apiParam {string} [bankAbbr] 银行缩写
     * @apiParamExample {string} 请求参数格式:
     * ?id=123&page=1&perpage=20
     * @apiVersion 1.0.0
     * @apiErrorExample {json} 错误返回值:
     * {
     * "code": 10003,
     * "msg": "ParametersError [Method]:get_tests参数错误!",
     * "error": {
     * "id": "",
     * "page": "",
     * "perpage": ""
     * },
     * "status": "fail"
     * }
     * @apiSuccessExample {json} 正确返回值:
     * {
     * "code": 200,
     * "msg": "OK ",
     * "data": [
     * {
     * "id": "622051004185471233",
     * "testCode": "000050",
     * }
     * ],
     * "status": "ok",
     * "count": "14"
     * }
     */
    @RequestMapping(value = "addBank", method = RequestMethod.POST)
    @ResponseBody
    public String addBank(Bank bank) {
        bankBiz.insertSelective(bank);
        logger.info("1");
        return null;
    }


    }
